From 479dab849873830184e3b53a903a3d3246b48e1a Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Wed, 18 Mar 2015 20:24:10 -0400 Subject: [PATCH] libxc: xc_physdev_map return -1 and populate errno. The users of these (qemu) check for a negative value so we are safe in regards to that. However they also use the return value to inform the user of the error. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Ian Campbell --- tools/libxc/xc_physdev.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c index cf02d85e6d..9b064b8787 100644 --- a/tools/libxc/xc_physdev.c +++ b/tools/libxc/xc_physdev.c @@ -43,8 +43,10 @@ int xc_physdev_map_pirq(xc_interface *xch, struct physdev_map_pirq map; if ( !pirq ) - return -EINVAL; - + { + errno = EINVAL; + return -1; + } memset(&map, 0, sizeof(struct physdev_map_pirq)); map.domid = domid; map.type = MAP_PIRQ_TYPE_GSI; @@ -72,8 +74,10 @@ int xc_physdev_map_pirq_msi(xc_interface *xch, struct physdev_map_pirq map; if ( !pirq ) - return -EINVAL; - + { + errno = EINVAL; + return -1; + } memset(&map, 0, sizeof(struct physdev_map_pirq)); map.domid = domid; map.type = MAP_PIRQ_TYPE_MSI; -- 2.30.2